# file = open('D:/a.txt',mode='r')
# lines_list = file.readlines()
# for line in lines_list:
#     print(line,end='')
# file.close()

file = open('D:/test.txt',mode='r',encoding='gbk')
lines = file.readlines()
print(lines)
lines[1]="修改第二行内容\n"
file.close()

file = open('D:/a.txt',mode='w')
file.writelines(lines)
file.close()

